﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Agility.Web;

namespace Agility.Testing.Web
{
    [TestFixture]
    public class UserTests
    {
        User user;
        #region optional setup and tear down methods
        //// Called before the first test to setup the whole fixture
        //[TestFixtureSetUp]
        //public void TestFixtureSetup()
        //{
        //}

        //// Called after the last test to tear down the whole fixture
        //[TestFixtureTearDown]
        //public void TestFixtureTearDown()
        //{
        //}

        //// Called before each test
        [SetUp]
        public void TestSetup()
        {
            this.user = new User();
        }

        //// Called after each test
        //[TearDown]
        //public void TestTearDown()
        //{ 
        //}

        #endregion

        [Test]
        [Category("UnitTest")]
        public void TestDisplayNameFriendlyNameSet()
        {
            string expected = "My Friendly Name";
            string actual;
            this.user.FriendlyName = expected;
            actual = this.user.DisplayName;
            Assert.AreEqual(expected, actual);
        }

        [Test]
        [Category("UnitTest")]
        public void TestDisplayNameFriendlyNameNotSet()
        {
            string expected = "My User Name";
            string actual;
            this.user.Name = expected;
            actual = this.user.DisplayName;
            Assert.AreEqual(expected, actual);
        }

        [Test]
        [Category("UnitTest")]
        public void TestFriendlyName()
        {
            string expected = "My Friendly Name";
            string actual;
            this.user.FriendlyName = expected;
            actual = this.user.FriendlyName;
            Assert.AreEqual(expected, actual);
        }
    }

}
